import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import WhiteBoard      from '@/components/WhiteBoard'
import CameraLiving      from '@/components/CameraLiving'
import StreamLiving      from '@/components/StreamLiving'
import Message      from '@/components/Message'

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/whiteboard',
      name: 'WhiteBoard',
      component: WhiteBoard
    },
    {
      path: '/camera',
      name: 'CameraLiving',
      component: CameraLiving
    },
    {
      path: '/stream',
      name: 'StreamLiving',
      component: StreamLiving
    },
    {
      path: '/message',
      name: 'Message',
      component: Message
    }
  ]
})
